package conexaosimples;

import java.sql.PreparedStatement;
import java.sql.Connection;
import java.sql.SQLException;

public class TestaRemocao {
	public static void main(String[] args) throws SQLException {
		
		try( Connection connection = Database.getConnection() ){

			String sql = "DELETE FROM CORE_MATERIAL$ WHERE FN_MATERIALID > 15615 ";

			try(PreparedStatement statement = connection.prepareStatement( sql ) ){
	
				boolean resultado = statement.execute( sql );
				System.out.println(resultado);
	
				int linhaDeletadas =  statement.getUpdateCount();
				System.out.println("total linhas deletadas: " + linhaDeletadas);
			}
 
		}catch (SQLException e){
		    System.out.println("Erro no Excluir: "+ e.getMessage() );
		}
	
	}

}
